// ===================== 排版 =====================
// 字体大小
// 定义字体(px)单位，小于20都为px单位字体:text-20
@for $i from 9 to 20 {
  .text-#{$i} {
    font-size: $i + px;
  }
}
// 定义字体(rpx)单位，大于或等于20的都为rpx单位字体:text-20
@for $i from 20 through 40 {
  .text-#{$i} {
    font-size: $i + rpx;
  }
}

// 字体粗细
.font-400 {
  font-weight: 400;
}
.font-600 {
  font-weight: 600;
}

// 字体样式
.italic {
  font-style: italic;
}
.not-italic {
  font-style: normal;
}

// 文本对齐
.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.text-justify {
  text-align: justify;
}

// 文本装饰
.underline {
  text-decoration-line: underline;
}
.no-underline {
  text-decoration: none;
}
.line-through {
  text-decoration-line: line-through;
}

// 文本溢出
.overflow-ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.overflow-ellipsis-2 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.overflow-ellipsis-3 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.overflow-ellipsis-4 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.overflow-ellipsis-5 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

// 布局
// ===================== Display =====================
.block {
  display: block;
}
.inline-block {
  display: inline-block;
}
.hidden {
  display: none;
}
.min-w-0 {
  min-width: 0;
}
// ===================== Flex =====================
// 容器
/* #ifndef APP-NVUE */
.flex {
  display: flex;
}
/* #endif */
.inline-flex {
  display: inline-flex;
}
.flex-row {
  flex-direction: row;
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.flex-nowrap {
  flex-wrap: nowrap;
}
.justify-start {
  justify-content: flex-start;
}
.justify-end {
  justify-content: flex-end;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-around {
  justify-content: space-around;
}
.justify-evenly {
  justify-content: space-evenly;
}
.items-start {
  align-items: flex-start;
}
.items-end {
  align-items: flex-end;
}
.items-center {
  align-items: center;
}
.items-baseline {
  align-items: baseline;
}
.items-stretch {
  align-items: stretch;
}
// 项目
.flex-1 {
  flex: 1 1 0;
}
.flex-initial {
  flex: 0 1 auto;
}

// ===================== Position =====================
.static {
  position: static;
}
.fixed {
  position: fixed;
}
.absolute {
  position: absolute;
}
.relative {
  position: relative;
}
.sticky {
  position: sticky;
}

// ===================== Floats =====================
.float-right {
  float: right;
}
.float-left {
  float: left;
}
.float-none {
  float: none;
}
.clear-right {
  clear: right;
}
.clear-left {
  clear: left;
}
.clear-both {
  clear: both;
}

// 定义内外边距，历遍1-80
@for $i from 0 through 80 {
  // 只要双数和能被5除尽的数
  @if $i % 2 == 0 or $i % 5 == 0 {
    // 得出：m-30
    .m-#{$i} {
      margin: $i + rpx !important;
    }

    // 得出：p-30
    .p-#{$i} {
      padding: $i + rpx !important;
    }

    // 得出：mx-30
    .mx-#{$i} {
      margin-left: $i + rpx !important;
      margin-right: $i + rpx !important;
    }

    // 得出：my-30
    .my-#{$i} {
      margin-top: $i + rpx !important;
      margin-bottom: $i + rpx !important;
    }

    // 得出：px-30
    .px-#{$i} {
      padding-left: $i + rpx !important;
      padding-right: $i + rpx !important;
    }

    // 得出：py-30
    .py-#{$i} {
      padding-top: $i + rpx !important;
      padding-bottom: $i + rpx !important;
    }

    @each $short, $long in l left, t top, r right, b bottom {
      // 缩写版，结果如： ml-30
      // 定义外边距
      .m#{$short}-#{$i} {
        margin-#{$long}: $i + rpx !important;
      }

      // 定义内边距
      .p#{$short}-#{$i} {
        padding-#{$long}: $i + rpx !important;
      }
    }
  }
}
